package com.qsd.doc4jsimpple.constants;

import lombok.Data;
import lombok.Getter;

/**
 * * @Author xujunxia
 * * @Date 2024-12-09 18:58
 * * @Description TODO
 * * wb-0455@dtdream.com
 **/
@Getter
public enum ListTypeEnum {

    ORDER_LIST(1,"有序数组"),

    BULLET_LIST(2,"无需数组"),



    ;
    /**
     * 编号
     */
    private int code;
    /**
     * 名称
     */
    private String name;

    ListTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        for (ListTypeEnum type : ListTypeEnum.values()) {
            if (type.getCode()==code) {
                return type.name;
            }
        }
        return null;
    }


    public static ComponentTypeEnum getEnum(String code) {
        for (ComponentTypeEnum type : ComponentTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
